﻿Type=StaticCode
Version=6
ModulesStructureVersion=1
B4A=true
@EndOfDesignText@
'Code module
'Subs in this code module will be accessible from all modules.
Sub Process_Globals
	'These global variables will be declared once when the application starts.
	'These variables can be accessed from all modules.
	'Public uil,uilnocache,uilround,rilroundcorn As UniversalImageLoader
	Public myUIL As myUIL
	Public fa As FontAwesome
	Private lstShareSdkCfg As List
	Public ActiveBitmap As Bitmap=LoadBitmap(File.DirAssets,"indicator_active.png")
	Public InactiveBitmap As Bitmap=LoadBitmap(File.DirAssets,"indicator_inactive.png")
	Public bmpSexMan As Bitmap=LoadBitmap(File.DirAssets,"sexnan.png")
	Public bmpSexWoman As Bitmap=LoadBitmap(File.DirAssets,"sexnv.png")
	'模型
	Type Subject(name As String,img As String,id As String)
	Type Teacher(ID As String,realname As String,nickname As String,sexMen As Boolean,startPrice As String,teacheAge As Int,rateNum As String,ratePercent As String,distence As String,adWords As String,headimg As String,stunum As String,mobile As String,zzsfz As String,zzxuewei As String,zzzhengshu As String,zzzige As String,zzxinji As String,lng As String,lat As String)
	Type wvUrl(Url As String,allowZoom As Boolean,title As String)
	Type myInfo(kefu As String,rongyun_token As String,qqid As String,wxid As String,paypwd As String,headimg As String,sex As String,city As String,usertel As String,age As Int,uid As Int,commit As String,address As String,grade As String,jwd As String,cookie As String,nickname As String,school As String,yue As String,ordNum As Int,yhqNum As Int,favTeacherNum  As Int)
	Type UserInfoIM(isstu As Boolean,userid As String,headimg As String,username As String)
	Type yhq(yhqname As String,yhdid As Int,money As String,starttime As String,endtime As String,uselimit As String,withLimit As Boolean)
	Type kcItem(hours As String,kctype As String,kctitle As String,kcid As String,price_lssm As String,price_xssm As String,price_xsdz As String,trdid As String,addr As String,tecname As String,tecImg As String,time As String,status As String,sex As String,kemu As String,grade As String,shangmenfangshi As String,shiduanlst As List)
	Type OrderItem(ordersn As String,ordstatus As String,price As String,ordid As Int,seller As Teacher,itemname As String,ordTime As String)
	Type JqOrderItem(ordersn As String,ordstatus As String,price As String,ordid As Int,seller As Teacher,itemname As String,ordTime As String)
	Type CaiwuItem(title As String,id As String,apitype As String,amount As String,status As String,time As String)
	Type rateItem(id As Int,teachheadimg As String,teachname As String,ratetype As String,kcname As String,ordTime As String,content As String,contentTime As String)
	Type payItem(pid As String,title As String,money As String,noinpay As Boolean)
	Type checkupdatereq(cb As Object,subname As String)
	Type checkupdateres(ver As String,url As String,content As String,status As Int)
	'图片查看调用对象
	Type pvObj(Url As String,title As String)
	Type Student(name As String,age As Int,grade As String,school As String,img As String,keshi As Int,city As String)
	Type Fudaoban(name As String,finish As Boolean)
	Type netRes(nCode As Int,sData As String,obj As Object) '网络请求返回
	'lst里是市
	Type CityShen(name As String,lst As List)
	'lst里是区
	Type CityShi(name As String,lst As List)
	Private CityJsp As JSONParser=Null
	Private CityCurShen As CityShen
	'锦旗模型
	Type Jinqi(id As Int,sendby As Student,jqType As Int,evalStr As String,sDate As String,price As String)
	'评论模型
	Type pinglunitem(id As Int,sendby As Student,jqType As Int,evalStr As String,sDate As String,price As String)
	'常量
	Dim S_SHARETEXT As String="欢迎使用靠谱家教app下载地址:http://m.kaopuedu.com"
	Private gf As GalleryFinal
	Public S_JPUSH_PASS="kp123456",SHARE_APPKEY As String="110c6550f3e1f",BUGLY_APPID As String="900029248",KF_COMMON_ID As String="KEFU146381788423928"
	Public S_GalleryFinalTheme As Object=gf.GREEN
	Public N_ROUNDCORN=5dip As Int
	Public S_DATADIR As String=File.DirRootExternal&"/kpjj"
	Public S_SHARE=1,S_COMPARE_PRICE=2,S_NEWS=3,S_FEEDBACK=4,S_SETTING=5,S_CLIENTPHONE=6,S_PERSONALINFO=7,S_MYFAVTEACHER=8,S_KECHENGRATE=9,S_LOGOUT=10,S_NUMS_PER_PAGE=20,S_CUSTOMSERVICE=11,S_ABOUTUS=12 As Int
	Public S_APPNAME="靠谱家教",S_SUBJECTS="subjects",S_PAIXU_FINDTEACHER="paixufind",S_NIANJI_FINDTEACHER="grade",S_CITYLIST="citys",S_SKFS As String
	'webserver config
	Public S_APP_API As String="https://app.kaopuedu.com/"
	'Public S_APP_API As String="http://192.168.1.66/"
	Public S_WEBSITE As String="http://m.kaopuedu.com/"
	Public mi As myInfo
	Public bmpTelAnyWhere As Bitmap=LoadBitmap(File.DirAssets,"tel7x24.png")
	Type apiIndex(SHOWXTGGDETAIL As Int,GETXTGG As Int,GETADIMG As Int,GETNEARBYTEACHER As Int,APPSTARTBG As Int,CHECKUPDATE As Int,SHOWTEACHERRENZHEN As Int,SHOWTEACHERNOTE As Int,SHOWARTCONTENT As Int,REQORDNUMBYTEACHER As Int,REQNEWSLIST As Int,REQHELPYOUFINDTEACHER As Int,REQALLFUDAOBAN  As Int,REQUNCOMPLETEKC As Int,REQBINDTHIRDACCOUNT As Int,REQLOGINBYTHIRD As Int,REQCITYLIST As Int,REQTEACHERLIST As Int,REQEVALLISTBYTEACHER As Int,SUBJINQIORDER As Int,REQALLKCLISTBYTEACHER As Int,POSTRATE As Int,REQORDERREFUND As Int,REQORDDETAIL As Int,REQCHARGE1 As Int,REQCHARGE2 As Int,REQJQLST As Int,REQUNRATENUM  As Int,REQPAYPWDCHG As Int,REQINAPPPAY As Int,SUBMITORDER,REQMYRATE As Int,REQCAIWULST As Int,REQORDLST As Int,REQKECHENLIST As Int,ADDFAVTEACHER  As Int,MODIFYPASS As Int,MODIFYMYINFO As Int,UPLOADIMG As Int,REQJINQI As Int,ADDYHQ As Int,APPBANNER As Int,KEMU  As Int,MSTJ As Int,LOGIN As Int,LOGOUT As Int,GETYHQ As Int,REFUSHMYINFO As Int,MYFAVTEACHER As Int,DELFAVTEACHER As Int,SEARCHTEACHER As Int,LOGINWITHSMS As Int,REQSMS As Int,REGISTER As Int,REQTEACHERDETAIL As Int,RESETPASSWORD As Int,FEEDBACK As Int)
	Dim apiIdx As apiIndex
	apiIdx.Initialize
	apiIdx.APPBANNER=0
	apiIdx.KEMU=1
	apiIdx.MSTJ=2
	apiIdx.LOGIN=3
	apiIdx.LOGOUT=4
	apiIdx.GETYHQ=5
	apiIdx.REFUSHMYINFO=6
	apiIdx.MYFAVTEACHER=7
	apiIdx.DELFAVTEACHER=8
	apiIdx.SEARCHTEACHER=9
	apiIdx.LOGINWITHSMS=10
	apiIdx.REQSMS=11
	apiIdx.REGISTER=12
	apiIdx.REQTEACHERDETAIL=13
	apiIdx.RESETPASSWORD=14
	apiIdx.FEEDBACK=15
	apiIdx.ADDYHQ=16
	apiIdx.REQJINQI=17
	apiIdx.UPLOADIMG=18
	apiIdx.MODIFYMYINFO=19
	apiIdx.MODIFYPASS=20
	apiIdx.ADDFAVTEACHER=21
	apiIdx.REQKECHENLIST=22
	apiIdx.REQORDLST=23
	apiIdx.REQCAIWULST=24
	apiIdx.REQMYRATE=25
	apiIdx.SUBMITORDER=26
	apiIdx.REQINAPPPAY=27
	apiIdx.REQPAYPWDCHG=28
	apiIdx.REQUNRATENUM=29
	apiIdx.REQJQLST=30
	apiIdx.REQCHARGE1=31
	apiIdx.REQCHARGE2=32
	apiIdx.REQORDDETAIL=33
	apiIdx.REQORDERREFUND=34
	apiIdx.POSTRATE=35
	apiIdx.REQALLKCLISTBYTEACHER=36
	apiIdx.SUBJINQIORDER=37
	apiIdx.REQEVALLISTBYTEACHER=38
	apiIdx.REQTEACHERlist=39
	apiIdx.REQCITYLIST=40
	apiIdx.REQLOGINBYTHIRD=41
	apiIdx.REQBINDTHIRDACCOUNT=42
	apiIdx.REQUNCOMPLETEKC=43
	apiIdx.REQALLFUDAOBAN=44
	apiIdx.REQHELPYOUFINDTEACHER=45
	apiIdx.REQNEWSLIST=46
	apiIdx.REQORDNUMBYTEACHER=47
	apiIdx.SHOWARTCONTENT=48
	apiIdx.SHOWTEACHERNOTE=49
	apiIdx.SHOWTEACHERRENZHEN=50
	apiIdx.CHECKUPDATE=51
	apiIdx.APPSTARTBG=52
	apiIdx.GETNEARBYTEACHER=53
	apiIdx.GETADIMG=54
	apiIdx.GETXTGG=55
	apiIdx.SHOWXTGGDETAIL=56
	'ulv
	Public N_COLOR_ORANGE=0xFFFF6A00,N_COLOR_TITLE=0xFF009688 As Int,N_ULVMEMCACHE=15 As Int,N_ULVDISKCACHE=35 As Int,S_ULVCACHEDIR=File.DirInternalCache As String
	Public S_CLIENTPHONENUMBER="09912573888" As String
	
	'test
	Public S_TESTTEACHERHEADER As String="http://app.modao.cc/uploads/images/2268885/raw_1454036696.jpeg",S_TESTMYHEADER As String="assets://test_myheader.png"
	Public mChe As Map
	'mChe.Initialize
	Public su As StringUtils
End Sub
Public Sub urlencode(str As String) As String
	Return su.EncodeUrl(str,"UTF8")
End Sub
public Sub urldecode(str As String) As String
	Return su.DecodeUrl(str,"UTF8")
End Sub
Sub SetPadding(v As View, Left As Int, Top As Int, Right As Int, Bottom As Int)
	 Dim jo As JavaObject = v
	 jo.RunMethod("setPadding", Array As Object(Left, Top, Right, Bottom))
End Sub
Sub SetPaddingCommon(v As View)
	 Dim jo As JavaObject = v
	 Dim Left As Int=3dip, Top As Int=1dip, Right As Int=3dip, Bottom As Int=1dip
	 jo.RunMethod("setPadding", Array As Object(Left, Top, Right, Bottom))
End Sub
'Acceptable URIs examples
'"http://site.com/image.png" // from Web
'"file:///mnt/sdcard/image.png" // from SD card
'"file:///mnt/sdcard/video.mp4" // from SD card (video thumbnail)
'"content://media/external/images/media/13" // from content provider
'"content://media/external/video/media/13" // from content provider (video thumbnail)
'"assets://image.png" // from assets
'"drawable://" + R.drawable.img // from drawables (non-9patch images)
Sub loadimg (imgurl As String,v As View)
	myUIL.diskcache=True
	myUIL.memcache=False
	myUIL.ShowImage(v,imgurl)

End Sub
Sub loadimgroundcorn(imgurl As String,v As ImageView,cornerRadiusPixels As Int,marginPixels As Int)
	myUIL.diskcache=True
	myUIL.memcache=False
	v.Color=0
	myUIL.ShowRoundCornImage(v,imgurl,cornerRadiusPixels,marginPixels)
End Sub
Sub makeAllTextColor333(pa As Panel)
	makeAllTextColor(pa,Colors.Black,0xff333333)
End Sub
Sub str2mutiline(str As String,n As Int) As String
	Dim ret As String
	Do While str<>Null And str.Length>0
		If str.Length>n Then
			ret=ret&str.SubString2(0,n)&CRLF
			str=str.SubString2(n,str.Length)
		Else
			ret=ret&str&CRLF
			str=""
		End If
	Loop
	If ret.Length>0 And ret.EndsWith(CRLF) Then ret=ret.SubString2(0,ret.Length-1)
	Return ret
End Sub
Sub makeAllTextColor(pa As Panel,orgCol As Int,newCol As Int)
	For Each v As View In pa.GetAllViewsRecursive
		If v Is Label Then
			Dim lbl As Label=v
			If lbl.TextColor=orgCol Then lbl.TextColor=newCol
			'Log(lbl.Text)
		else if v Is Button Then
			Dim btn As Button=v
			If btn.TextColor=orgCol Then btn.TextColor=newCol
			'Log(btn)
		else if v Is EditText Then
			Dim edt As EditText=v
			If edt.TextColor=orgCol Then edt.TextColor=newCol
			'Log(edt)
		else if v Is Panel Then
			makeAllTextColor(v,orgCol,newCol)
		'	Log("p")
		End If
		'Log("org v:"&v)
	Next
	
End Sub
Sub loadimground(imgurl As String,v As View,strokeColor As Int,strokeWidth As Float)
	myUIL.diskcache=True
	Dim defHeader As BitmapDrawable
	defHeader.Initialize(LoadBitmap(File.DirAssets,"teacher.png"))
	defHeader.Gravity=Gravity.FILL
	myUIL.nFailResId=defHeader
	myUIL.memcache=False
	v.Color=0
	myUIL.ShowCircleImage(v,imgurl,strokeColor,strokeWidth)
End Sub
Sub MeasureTextWidth(v As View,str As String) As Float
	Dim cav As Canvas
	cav.Initialize(v)
	Dim tf As Typeface
	Dim ts As Float
	If v Is Button Then
		Dim btn As Button=v
		tf=btn.Typeface
		ts=btn.TextSize
	Else 
		Dim lbl As Label=v
		tf=lbl.Typeface
		ts=lbl.TextSize
	End If
	
	Return cav.MeasureStringWidth(str,tf,ts)
End Sub
Sub MeasureTextHeight(v As View,str As String) As Float
	Dim cav As Canvas
	cav.Initialize(v)
	Dim tf As Typeface
	Dim ts As Float
	If v Is Button Then
		Dim btn As Button=v
		tf=btn.Typeface
		ts=btn.TextSize
	Else 
		Dim lbl As Label=v
		tf=lbl.Typeface
		ts=lbl.TextSize
	End If
	Return cav.MeasureStringHeight(str,tf,ts)+5dip
End Sub
Sub setViewWrapContent(v As View)
	Try
		If v Is Button Then
		Dim btn As Button=v
		btn.Width=MeasureTextWidth(btn,btn.Text)
		btn.Height=MeasureTextHeight(btn,btn.Text)
	Else 
		Dim lbl As Label=v
		lbl.Width=MeasureTextWidth(lbl,lbl.Text)
'		lbl.Height=MeasureTextHeight(lbl,lbl.Text)
	End If
	Catch
		Log(LastException)
	End Try
End Sub
Public Sub setcommonpadding(v As View)
	Dim pl,pt As Int :pt=1dip :pl=5dip
	SetPadding(v,pl,pt,pl,pt)
End Sub
public Sub updateZZ(lbl As Label,val As String)
	lbl.Text=val
	lbl.Visible=True
	Dim w1,w2 As Int
	
	w1=8dip
	w2=2dip
	SetPadding(lbl,w1,w2,w1,w2)
	Dim cd As ColorDrawable
	Dim c1 As Int
	'Log(val)
	Select val.Trim
	Case "实名"
		c1=0xFF6891d3
	Case "学位"
		c1=0xffffa868
	Case "证书"
		c1=0xff84bc00
	Case "资格"
		c1=0xffff979a
	Case "一星"
		c1=0xffb493db
	Case "二星"
		c1=0xffb493db
	Case "三星"
		c1=0xffb493db
	Case "四星"
		c1=0xffb493db
	Case "五星"
		c1=0xffb493db
	Case "特级"
		c1=0xffb493db
	End Select
	cd.Initialize2(Colors.White,2dip,1dip,c1)
	lbl.TextColor=c1
	lbl.Background=cd
End Sub
Sub loadimg_nocache (imgurl As String,v As ImageView)
	myUIL.diskcache=False
	myUIL.memcache=False
	myUIL.ShowImage(v,imgurl)
End Sub
Public Sub setivsexsize(v As ImageView,ismen As Boolean)
	If ismen Then v.Width=10dip Else v.Width=7dip
	v.Height=10dip
End Sub
'统一入口便于后期可能的修改
public Sub T(msg As String)
	ToastMessageShow(msg,False)
End Sub
Public Sub showProgress(msg As String)
	ProgressDialogShow(msg)
End Sub
Public Sub L(msg As String)
	Log(msg)
End Sub
Public Sub long2datestr(l1 As Long) As String
	DateTime.DateFormat="yyyy/MM/dd"
	Return DateTime.Date(l1)&" "&DateTime.Time(l1)
End Sub
public Sub TL(msg As String)
	ToastMessageShow(msg,False)
	Log(msg)
End Sub
public Sub CreateCustomPanel(act As Panel,w As Int,h As Int) As Panel
	Dim p As Panel
	p.Initialize("")
	act.AddView(p,0,0,w,h)
	p.RemoveView
	Return p
End Sub
'Public Sub setImageUriRIV(riv As View,uri As String)
'	Dim jo As JavaObject
'	jo=riv
'	jo.RunMethod("setImageURI",Array As Object(ParseUri(uri)))
'End Sub

'fitXY=1,center=5,centerCrop=6
Public Sub setscaleType(v As View,st As Int)
	Dim jo As JavaObject=v
	jo.RunMethod("setScaleType",Array As Object(st))
End Sub
public Sub GetContext(obj As Object) As JavaObject
   Return GetBA(obj).GetField("context")
End Sub

Sub GetBA(obj As Object) As JavaObject
  Dim jo As JavaObject
  Dim cls As String = obj
  cls = cls.SubString("class ".Length)
  jo.InitializeStatic(cls)
  Return jo.GetFieldJO("processBA")
End Sub
'返回一个radiobutton或者null
Public Sub getSelectedRadioFromPanel(p As Panel) As RadioButton
	For Each v As RadioButton In p.GetAllViewsRecursive
		If v.Checked Then Return v
	Next
	Return Null
End Sub
public Sub setItemVal(p As Panel,val As String)
	Dim lbl As Label
	For Each v As View In p.GetAllViewsRecursive
		Log(v.Tag)
		If "val".EqualsIgnoreCase(v.Tag) Then
			lbl=v
			lbl.Text=val
		End If
	Next
	Return
End Sub
Private Sub initCityJsp
	If CityCurShen.IsInitialized Then Return
	Dim parser As JSONParser 
	CityCurShen.Initialize
	CityCurShen.lst.Initialize
	CityCurShen.name="新疆"
	parser.Initialize(g_store.getDef("cityjs","{data:[]}") )
	Dim root As Map = parser.NextObject 
	Dim data As List = root.Get("data") 
	For Each coldata As Map In data 
		Dim shi As CityShi
		shi.Initialize
		Dim parent_id As String = coldata.Get("parent_id") 
	    Dim region_id As String = coldata.Get("region_id") 
	    Dim region_name As String = coldata.Get("region_name") 
	    Dim children As List = coldata.Get("children") 
		shi.name=region_name
		shi.lst.Initialize
	    For Each colchildren As Map In children 
	        Dim parent_id As String = colchildren.Get("parent_id") 
	        Dim region_id As String = colchildren.Get("region_id") 
	        Dim region_name As String = colchildren.Get("region_name") 
			shi.lst.Add(region_name)
	    Next 
	    CityCurShen.lst.Add(shi)
	Next 
	Dim status As String = root.Get("status") 

	
End Sub
Public Sub getCurShen As CityShen
	initCityJsp
	Return CityCurShen
End Sub
'根据市名字获取区列表
public Sub getCityArr(shi As String) As CityShi
	initCityJsp
	Dim ts As CityShi
	For i=0 To CityCurShen.lst.Size-1
		ts=CityCurShen.lst.Get(i)
		If ts.name.EqualsIgnoreCase(shi) Then Exit
	Next
	Return ts
End Sub

'通用的方法
Public Sub AIO(act As Activity)
	SetEdtStyle(act,False)
End Sub
Public Sub SetEdtStyle(act As Panel,noPadding As Boolean)
	For Each v As View In act.GetAllViewsRecursive
		If GetType(v).ToLowerCase.Contains("panel")	 Then
			SetEdtStyle(v,noPadding)
		Else
			If GetType(v).ToLowerCase.Contains("edittext") Then
				SetEdtStyle2(v,noPadding)
			End If
		End If
	Next
End Sub
Public Sub SetEdtStyle2(edt As EditText,nopadding As Boolean)
	Dim cd As ColorDrawable
	cd.Initialize(Colors.White,5dip)
	edt.Background=cd
	If nopadding Then SetPadding(edt,0,0,0,0)
End Sub
Public Sub showTecDetail(tecid As Int)
	g_store.conf.Put("tecid",tecid)
	StartActivity(actTeacherDetail)
End Sub
Public Sub startWV(wvobj As wvUrl)
	If wvobj.IsInitialized Then
		g_store.conf.Put("wvurl",wvobj)
		StartActivity(actWebView)
	End If
End Sub
Public Sub ShowUrl(u As String)
	Dim wv As wvUrl
	wv.Initialize
	wv.Url=u
	g_store.conf.Put("wvurl",wv)
	StartActivity(actWebView)
End Sub
Public Sub ShowUrl2(u As String,title As String)
	Dim wv As wvUrl
	wv.Initialize
	wv.Url=u
	wv.title=title
	g_store.conf.Put("wvurl",wv)
	StartActivity(actWebView)
End Sub
Public Sub ShowUrlOutter(u As String)
	Dim v As Intent
	v.Initialize(v.ACTION_VIEW,u)
	StartActivity(v)
End Sub
Public Sub ShowPic(u As String)
	Dim wv As pvObj
	wv.Initialize
	wv.Url=u
	ShowPic2(wv)
End Sub
Public Sub ShowPic2(pv As pvObj)
	myUIL.defScaleType=Null
	CallSubDelayed2(actPhotoViewer,"showPic",pv)
End Sub
Sub ParseUri(s As String) As Object
    Dim r As Reflector
    Return r.RunStaticMethod("android.net.Uri", "parse", Array As Object(s), Array As String("java.lang.String"))                
End Sub
'设置fontawesome,支持button和label
Public Sub setFA(v As View,ico_name As String,extra As String)
	If Not(fa.IsInitialized) Then fa.Initialize
	If v Is Button Then
		Dim btn As Button=v
		btn.Typeface=fa.FontAwesomeTypeface
		btn.Text=fa.GetFontAwesomeIconByName(ico_name)&extra
	else if v Is RadioButton Then
		Dim rad As RadioButton=v
		rad.Typeface=fa.FontAwesomeTypeface
		rad.Text=fa.GetFontAwesomeIconByName(ico_name)&extra
	else if v Is Label Then
		Dim lbl As Label=v
		If ico_name.IndexOf("rmb")>-1 Then
			lbl.Text="￥"&extra
		Else
			lbl.Typeface=fa.FontAwesomeTypeface
			lbl.Text=fa.GetFontAwesomeIconByName(ico_name)&extra
			If ico_name.IndexOf("left")>-1 Then
				'返回按钮
				chgLeftBtn(lbl)
			End If
		End If
		
	End If
End Sub
'设置fontawesome,支持button和label
Public Sub setFA2(v As View,ico_name As String,pre As String)
	If Not(fa.IsInitialized) Then fa.Initialize
	If v Is Button Then
		Dim btn As Button=v
		btn.Typeface=fa.FontAwesomeTypeface
		btn.Text=pre&fa.GetFontAwesomeIconByName(ico_name)
	else if v Is RadioButton Then
		Dim rad As RadioButton=v
		rad.Typeface=fa.FontAwesomeTypeface
		rad.Text=pre&fa.GetFontAwesomeIconByName(ico_name)
	else if v Is Label Then
		Dim lbl As Label=v
		If ico_name.IndexOf("rmb")>-1 Then
			lbl.Text=pre&"￥"
		Else
			lbl.Typeface=fa.FontAwesomeTypeface
			lbl.Text=pre&fa.GetFontAwesomeIconByName(ico_name)
		End If
	End If
End Sub
Public Sub hideIme
	Dim ime As IME
	ime.Initialize("")
	ime.HideKeyboard
End Sub
'by RoundImage lib
'Public Sub getRoundImg(bmp As Bitmap) As Bitmap
'	Return ri.CreateBitmap(bmp)
'End Sub
Public Sub copyStr(str As String)
	Dim clip As BClipboard
	clip.setText(str)
	T("文本已复制")
End Sub

#Region 教师列表过滤
Public Sub showTecLst(parm As Map)
	
End Sub
#End Region
#Region api url
'
Public Sub getApi(idx As Int) As String
	Dim ret As String
	Select idx
	Case apiIdx.APPBANNER
		ret="app/index/app_banner"
	Case apiIdx.KEMU
		ret="app/index/kemu"
	Case apiIdx.LOGIN
		ret="home/login/index"
	Case apiIdx.LOGOUT
		ret="home/login/logout"
	Case apiIdx.GETYHQ
		ret="home/kao/member_yhj"
	Case apiIdx.REFUSHMYINFO
		ret="home/kao"
	Case apiIdx.MYFAVTEACHER
		ret="home/kao/gz_teach"
	Case apiIdx.DELFAVTEACHER
		ret="home/write/del_gz"
	Case apiIdx.SEARCHTEACHER
		ret="app/index/js_minute"
	Case apiIdx.MSTJ
		ret="app/index/js_tj_list"
	Case apiIdx.LOGINWITHSMS
		ret="home/login/sms_code_login"
	Case apiIdx.REQSMS
		ret="app/index/get_sms"
	Case apiIdx.REGISTER
		ret="app/register/zhuce"
	Case apiIdx.REQTEACHERDETAIL
		ret="app/index/js_xx"
	Case apiIdx.RESETPASSWORD
		ret="app/register/reset_one"
	Case apiIdx.FEEDBACK
		ret="app/updata/feed"
	Case apiIdx.ADDYHQ
		ret="home/write/up_yhj"
	Case apiIdx.REQJINQI
		ret="app/index/banner_list"
	Case apiIdx.UPLOADIMG
		ret="home/kao/upload"
	Case apiIdx.MODIFYMYINFO
		ret="home/write/index"
	Case apiIdx.MODIFYPASS
		ret="home/write/member_pwd"
	Case apiIdx.ADDFAVTEACHER
		ret="home/write/add_gz"
	Case apiIdx.REQKECHENLIST
		ret="home/kao/member_kechen"
	Case apiIdx.REQORDLST
		ret="home/kao/member_order"
	Case apiIdx.REQCAIWULST
		ret="home/MyMoney/member_money_io"
	Case apiIdx.REQMYRATE
		ret="home/kao/member_pl"
	Case apiIdx.SUBMITORDER
		ret="home/orderdata/order"
	Case apiIdx.REQINAPPPAY
		ret="home/orderdata/order_pay"
	Case apiIdx.REQPAYPWDCHG
		ret="home/MyMoney/up_pay_pwd"
	Case apiIdx.REQUNRATENUM
		ret="home/kao/cha_pl"
	Case apiIdx.REQJQLST
		ret="home/kao/member_jinqi"
	Case apiIdx.REQCHARGE1
		ret="home/MyMoney/chongzhi"
	Case apiIdx.REQCHARGE2
		ret="home/MyMoney/dinpay"
	Case apiIdx.REQORDDETAIL
		ret="home/kao/member_order_view"
	Case apiIdx.REQORDERREFUND
		ret="home/orderdata/order_paytk"
	Case apiIdx.POSTRATE
		ret="home/write/commit"
	Case apiIdx.REQALLKCLISTBYTEACHER
		ret="app/index/kc_list"
	Case apiIdx.SUBJINQIORDER
		ret="home/orderdata/jq_order"
	Case apiIdx.REQEVALLISTBYTEACHER
		ret="app/index/pl"
	Case apiIdx.REQTEACHERLIST
		ret="app/index/js_list"
	Case apiIdx.REQCITYLIST
		ret="app/index/city"
	Case apiIdx.REQLOGINBYTHIRD
		ret="home/login/san_code_login"
	Case apiIdx.REQBINDTHIRDACCOUNT
		ret="home/write/bding"
	Case apiIdx.REQUNCOMPLETEKC
		ret="home/kao/member_kechen"
	Case apiIdx.REQALLFUDAOBAN
		ret="app/index/kc_list?kc_type=3"
	Case apiIdx.REQHELPYOUFINDTEACHER
		ret="app/updata/bang_zhao_teach"
	Case apiIdx.REQNEWSLIST
		ret="app/qita"
	Case apiIdx.REQORDNUMBYTEACHER
		ret="home/kao/member_buy_num"
	Case apiIdx.SHOWARTCONTENT
		ret="app/qita/article?content_id="
	Case apiIdx.SHOWTEACHERNOTE
		ret="app/qita/js_jianjie?js_id="
	Case apiIdx.SHOWTEACHERRENZHEN
		ret="app/qita/js_renzheng?js_id="
	Case apiIdx.CHECKUPDATE
		ret="app/qita/stu_upgrade"
	Case apiIdx.APPSTARTBG
		ret="app/qita/app_photo"
	Case apiIdx.GETNEARBYTEACHER
		ret="app/index/js_map_list"
	Case apiIdx.GETADIMG
		ret="app/qita/commercials"
	Case apiIdx.GETXTGG
		ret="app/qita/system_content?page=1&size=8"
	Case apiIdx.SHOWXTGGDETAIL
		ret="app/qita/system_content_xx?id="
	Case Else
		ret=""
	End Select
	ret=S_APP_API&ret
	Log("getApi:"&idx&CRLF&ret)
	Return ret
End Sub
Public Sub sharestr(str As String)
	Dim i As Intent
	i.Initialize(i.ACTION_SEND,"")
	i.PutExtra("android.intent.extra.TEXT",str)
	i.SetType("text/plain")
	i.WrapAsIntentChooser("分享")
	StartActivity(i)
End Sub
Public Sub calltel(tel As String)
	Dim i As Intent
	If tel.ToLowerCase.StartsWith("tel:")=False Then tel="tel:"&tel.ToLowerCase
	i.Initialize(i.ACTION_VIEW,tel)
	StartActivity(i)
End Sub
public Sub combinPic(pic As String) As String
	If pic.ToLowerCase.StartsWith("http") Then Return pic
	Dim ret As String=S_TESTMYHEADER
	If pic.Length>4 Then
		ret=S_APP_API
		ret=ret.Replace("app/","")
		ret=ret&pic
	Else
		ret=""
	End If
	Return ret
End Sub
public Sub updateUserInfoForIM(uid As String,name As String,img As String,isstu As Boolean)
	Dim ui1 As UserInfoIM
	ui1.Initialize
	ui1.UserId=uid
	ui1.username=name
	ui1.headimg=img
	ui1.isstu=isstu
	g_store.put("IM"&ui1.UserId,ui1)
	L("UpdateUI:"&uid&" "&name&" "&img)
End Sub
'默认不是学生
Public Sub getUserInfoForIM(uid As String) As UserInfo_ry
	Dim mui As UserInfoIM
	If g_store.ContainsKey("IM"&uid) Then
		mui=g_store.get("IM"&uid)
	Else
		mui.Initialize
		mui.userid=uid
		mui.username=uid
		mui.isstu=False
	End If
	Dim ui1 As UserInfo_ry
	ui1.init(uid)
	ui1.Name=mui.username
	If mui.isstu Then mui.username=mui.username&"[学生]" Else mui.username=mui.username&"[老师]"
	ui1.PortraitUri=mui.headimg
	Return ui1
End Sub
Public Sub isLogin As Boolean
	Return g_store.conf.GetDefault("islogin",False)
End Sub
Public Sub getRichStr(instr As String) As RichString
	Dim rs As RichString
	rs.Initialize(instr)
	Return rs
End Sub
Public Sub getShareSdkCfgList As List
	If lstShareSdkCfg.IsInitialized And lstShareSdkCfg.Size>0 Then Return lstShareSdkCfg
	lstShareSdkCfg.Initialize
	Dim m As Map
	m.Initialize
	m.Put("pname","Wechat")
	m.Put("Id","1")
	m.Put("SortId",1)
	m.Put("AppId","wx98b3b7e7c8ff810e")
	m.Put("AppSecret","e008c0e847a2109278cb930b0248e6ca")
	m.Put("BypassApproval","false")
	m.Put("Enable","true")
	lstShareSdkCfg.Add(m)
	Dim m As Map
	m.Initialize
	m.Put("pname","WechatMoments")
	m.Put("Id","2")
	m.Put("SortId",2)
	m.Put("AppId","wx98b3b7e7c8ff810e")
	m.Put("AppSecret","e008c0e847a2109278cb930b0248e6ca")
	m.Put("BypassApproval","false")
	m.Put("Enable","true")
	lstShareSdkCfg.Add(m)
	Dim m As Map
	m.Initialize
	m.Put("pname","WechatFavorite")
	m.Put("Id","3")
	m.Put("SortId",3)
	m.Put("AppId","wx98b3b7e7c8ff810e")
	m.Put("AppSecret","e008c0e847a2109278cb930b0248e6ca")
	m.Put("Enable","true")
	lstShareSdkCfg.Add(m)
	Dim m As Map
	m.Initialize
	m.Put("pname","QQ")
	m.Put("Id","4")
	m.Put("SortId",4)
	m.Put("AppId","1105462776")
	m.Put("AppKey","UCkTh71GMn6xYPpe")
	m.Put("ShareByAppClient","true")
	m.Put("Enable","true")
	lstShareSdkCfg.Add(m)
	Dim m As Map
	m.Initialize
	m.Put("pname","ShortMessage")
	m.Put("Id","5")
	m.Put("SortId",5)
	m.Put("Enable","true")
	lstShareSdkCfg.Add(m)
	Return lstShareSdkCfg
End Sub
#End Region
#Region ui change
Public Sub chgLeftBtn(v As Label)
	v.TextSize=28
	v.Top=4dip
End Sub
#End Region